import { fun } from './js/md'
console.log("Hello, Webpack 5!");
import './css/index.css'
import './less/index.less'
import './sass/index.scss'
import './css/iconfont.css'
import {
    sum,
    squre
} from './js/md'
console.log(sum(2, 3));
console.log(squre(3, 3));
const add = (a) => {
    return a
}
add(2);
const btn = document.querySelector('#btn');
btn.addEventListener('click', () => {
    // 魔法命名
    import(/*webpackChunkName: "sum"*/'./js/sum').then(res => {
        console.log(res.sumCount(2, 5), '导入');
    })
})
console.log('更新代码11111');
console.log(fun(2));
if (module.hot) {
    module.hot.accept('./js/md.js')
}
if ('serviceWorker' in navigator) {
    window.addEventListener('load', () => {
      navigator.serviceWorker.register('/service-worker.js').then(registration => {
        console.log('SW registered: ', registration);
      }).catch(registrationError => {
        console.log('SW registration failed: ', registrationError);
      });
    });
  }